package edu.gmu.middleware;

/**
 * Binds a Class (presumably one that implements Message) to an identifier.
 * @author James Pope
 */
public class MessageBinding
{
    // Instance variables
    private int    topic  = 0;
    private Class  boundClass = null;
    
    /**
     * Creates a new MessageRegistry with specified values.
     * @param topic
     * @param boundClass
     */
    public MessageBinding(int topic, Class boundClass)
    {
        this.topic  = topic;
        this.boundClass = boundClass;
    }

    /**
     * Gets topic.
     * @return topic
     */
    public int getTopic()
    {
        return this.topic;
    }

    /**
     * Gets boundClass.
     * @return boundClass
     */
    public Class getBoundClass()
    {
        return this.boundClass;
    }

    /**
     * Gets this String facsimile of this object.
     * @return name
     */
    public String toString( )
    {
        return this.boundClass.getName() + " bound to " + this.topic;
    }
}